package day05;

public class Array2Demo {
    public static void main(String[] args) {
        // int[][] arr = new int[3][];
        // System.out.println(arr);
        // System.out.println(arr[0]);

        int[][] arr = { { 1, 2, 3 }, { 4, 5 }, { 8 } };
        int sum = 0;
        for (int x = 0; x < arr.length; x++) {
            for (int y = 0; y < arr[x].length; y++) {
                System.out.print(arr[x][y] + " ");
                sum += arr[x][y];
            }
            System.out.println();
        }
        System.out.println(sum);
    }
}
